﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Composite.Presentation.Events;
using System.Linq.Expressions;
using MVVMFramework.Core.Model;
using MVVMFramework.Core.ViewModel;

namespace MVVMFramework.Messaging
{
    public class SearchTaskMessage : CompositePresentationEvent<SearchTaskMessageArgs>
    {

    }

    public abstract class SearchTaskMessageArgs : IListVMInitializeArgs
    {
        public SearchTaskMessageArgs()
        {
            this.RequiresPaging = true;
        }

        public Type EntityType { get; protected set; }

        public bool RequiresPaging { get; set; }

        public IDomainModel ExistingModel { get; set; } //enables sharing the same model on more viewmodels
    }

    public class SearchTaskMessageArgs<T> : SearchTaskMessageArgs
    {
        public SearchTaskMessageArgs()
        {
            base.EntityType = typeof(T);
        }

        public Func<Expression<Func<T, bool>>> FilterExpression { get; set; }
    }
}
